public class CartesianPoint {
	private int x;
	private int y;

	public CartesianPoint(int x, int y) {
		this.x = x;
		this.y = y;
	}

	public int getX() {
		return x;
	}

	public int getY() {
		return y;
	}

	public double distanceTo0() {
		return Math.sqrt(this.x * this.x + this.y * this.y);
	}

	public double distanceTo(CartesianPoint that) {
		double a = this.x - that.x;
		double b = this.y - that.y;
		return Math.sqrt(a * a + b * b);
	}

	public CartesianPoint translate(int a, int b) {
		return new CartesianPoint(this.x + a, this.y + b);

	}
}
